package com.ruoyi.interfaced.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.interfaced.mapper.ShopUserInterMapper;
import com.ruoyi.interfaced.domain.ShopUserInter;
import com.ruoyi.interfaced.service.IShopUserInterService;

/**
 * 用户信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-11-28
 */
@Service
public class ShopUserInterServiceImpl implements IShopUserInterService
{
    @Autowired
    private ShopUserInterMapper shopUserMapper;

    /**
     * 查询用户是否存在
     * @return
     */
    @Override
    public List<ShopUserInter> SelectShopUserListWxOpenid(String WxOpenid) {
        return shopUserMapper.SelectShopUserListWxOpenid(WxOpenid);
    }

    /**
     * 支付扣除余额
     */
    @Override
    public int ShopUserDeduction(ShopUserInter shopUserInter) {
        return shopUserMapper.ShopUserDeduction(shopUserInter);
    }

    /**
     * 添加用户
     */
    @Override
    public int insert(ShopUserInter shopUser)
    {
        return shopUserMapper.insert(shopUser);
    }
    /**
     * 查询用户信息
     * 
     * @param wxOpenid 用户信息主键
     * @return 用户信息
     */
    @Override
    public ShopUserInter selectShopUserByWxOpenid(String wxOpenid)
    {
        return shopUserMapper.selectShopUserByWxOpenid(wxOpenid);
    }

    /**
     * 查询用户信息列表
     * 
     * @param shopUser 用户信息
     * @return 用户信息
     */
    @Override
    public List<ShopUserInter> selectShopUserList(ShopUserInter shopUser)
    {
        return shopUserMapper.selectShopUserList(shopUser);
    }

    /**
     * 新增用户信息
     * 
     * @param shopUser 用户信息
     * @return 结果
     */
    @Override
    public int insertShopUser(ShopUserInter shopUser)
    {
        return shopUserMapper.insertShopUser(shopUser);
    }

    /**
     * 修改用户信息
     * 
     * @param shopUser 用户信息
     * @return 结果
     */
    @Override
    public int updateShopUser(ShopUserInter shopUser)
    {
        return shopUserMapper.updateShopUser(shopUser);
    }

    /**
     * 批量删除用户信息
     * 
     * @param wxOpenids 需要删除的用户信息主键
     * @return 结果
     */
    @Override
    public int deleteShopUserByWxOpenids(String[] wxOpenids)
    {
        return shopUserMapper.deleteShopUserByWxOpenids(wxOpenids);
    }

    /**
     * 删除用户信息信息
     * 
     * @param wxOpenid 用户信息主键
     * @return 结果
     */
    @Override
    public int deleteShopUserByWxOpenid(String wxOpenid)
    {
        return shopUserMapper.deleteShopUserByWxOpenid(wxOpenid);
    }
}
